<template>
	<div class="goods-desc">
		<!-- 导航 -->
		<van-nav-bar
			title="图文介绍"
			fixed
			safe-area-inset-top
			:z-index="5"
			placeholder
			left-arrow
			left-text="返回"
			@click-left="$router.back()"
			@click-right="$router.push('/')"
		>
			<template #right>
				<van-icon name="wap-home-o" size="20" />
			</template>
		</van-nav-bar>
		<!-- 标题 -->
		<h2 class="title">{{ desc.title }}</h2>
		<!-- 内容 -->
		<div class="content" v-html="desc.content"></div>
	</div>
</template>

<script>
import { getGoodsDesc } from '@/apis/index.js';
export default {
	async created() {
		this.desc = (await getGoodsDesc(this.$route.params.id)).data.message[0];
		console.log(this.desc);
	},
	data() {
		return {
			desc: []
		};
	}
};
</script>

<style scoped lang="less">
.title {
	font-size: 18px;
	color: #0088d1;
	font-weight: bold;
	border-bottom: 1px #ccc solid;
	height: 40px;
	line-height: 40px;
	padding: 5px;
}
.content {
	font-size: 14px;
	color: #53575e;
	line-height: 1.5;
	padding: 5px;
}
</style>
